<%@ page import="org.bjou.Course" %>
<!doctype html>
<html>
	<head>
		 <meta name="layout" content="pertho">
		<g:set var="entityName" value="${message(code: 'course.label', default: 'Course')}" />
		<title><g:message code="default.edit.label" args="[entityName]" /></title>
	</head>
	<body>
          <body>
          <div class="container">
    <div class="row">
      <div class="twelve columns">
        <div class="box_c">
          <div class="box_c_heading cf">
            <p><g:message code="default.edit.label" args="[entityName]" /></p>
          </div>
          <div class="box_c_content">
             <!-- start -->
          <div id="edit-course" class="content scaffold-edit" role="main">
			<g:if test="${flash.message}">
			<div class="message" role="status">${flash.message}</div>
			</g:if>
			<g:hasErrors bean="${courseInstance}">
			<ul class="errors" role="alert">
				<g:eachError bean="${courseInstance}" var="error">
				<li <g:if test="${error in org.springframework.validation.FieldError}">data-field-id="${error.field}"</g:if>><g:message error="${error}"/></li>
				</g:eachError>
			</ul>
			</g:hasErrors>
			<g:form method="post" >
				<g:hiddenField name="id" value="${courseInstance?.id}" />
				<g:hiddenField name="version" value="${courseInstance?.version}" />
				<fieldset class="form">
					<div class="fieldcontain ${hasErrors(bean: courseInstance, field: 'credit', 'error')} ">
	<label for="credit">
		<g:message code="course.credit.label" default="Credit" />
		
	</label>
	<g:field type="number" name="credit" value="${fieldValue(bean: courseInstance, field: 'credit')}"/>
</div>

<div class="fieldcontain ${hasErrors(bean: courseInstance, field: 'courseType', 'error')} ">
	<label for="courseType">
		<g:message code="course.courseType.label" default="Course Type" />
		
	</label>
	<g:textField name="courseType" value="${courseInstance?.courseType}"/>
</div>

<div class="fieldcontain ${hasErrors(bean: courseInstance, field: 'courseProperty', 'error')} ">
	<label for="courseProperty">
		<g:message code="course.courseProperty.label" default="Course Property" />
		
	</label>
	<g:textField name="courseProperty" value="${courseInstance?.courseProperty}"/>
</div>

<div class="fieldcontain ${hasErrors(bean: courseInstance, field: 'courseId', 'error')} ">
	<label for="courseId">
		<g:message code="course.courseId.label" default="Course Id" />
		
	</label>
	<g:textField name="courseId" value="${courseInstance?.courseId}"/>
</div>

<div class="fieldcontain ${hasErrors(bean: courseInstance, field: 'courseName', 'error')} ">
	<label for="courseName">
		<g:message code="course.courseName.label" default="Course Name" />
		
	</label>
	<g:textField name="courseName" value="${courseInstance?.courseName}"/>
</div>

<div class="fieldcontain ${hasErrors(bean: courseInstance, field: 'examType', 'error')} ">
	<label for="examType">
		<g:message code="course.examType.label" default="Exam Type" />
		
	</label>
	<g:textField name="examType" value="${courseInstance?.examType}"/>
</div>

<div class="fieldcontain ${hasErrors(bean: courseInstance, field: 'courseTerm', 'error')} ">
	<label for="courseTerm">
		<g:message code="course.courseTerm.label" default="Course Term" />
		
	</label>
   <g:fieldValue  bean="${courseInstance}"   field="courseTerm" />
	
</div>

<div class="fieldcontain ${hasErrors(bean: courseInstance, field: 'entryTerm', 'error')} ">
	<label for="entryTerm">
		<g:message code="course.entryTerm.label" default="Entry Term" />
		
	</label>
  <g:fieldValue  bean="${courseInstance}"   field="entryTerm" />
  
</div>

<div class="fieldcontain ${hasErrors(bean: courseInstance, field: 'examNumber', 'error')} ">
	<label for="examNumber">
		<g:message code="course.examNumber.label" default="Exam Number" />
		
	</label>
	<g:textField name="examNumber" value="${courseInstance?.examNumber}"/>
</div>

<div class="fieldcontain ${hasErrors(bean: courseInstance, field: 'examNumberB', 'error')} ">
	<label for="examNumberB">
		<g:message code="course.examNumberB.label" default="Exam Number B" />
		
	</label>
	<g:textField name="examNumberB" value="${courseInstance?.examNumberB}"/>
</div>

<div class="fieldcontain ${hasErrors(bean: courseInstance, field: 'department', 'error')} ">
	<label for="department">
		<g:message code="course.department.label" default="Department" />
		
	</label>
	<g:select id="department" name="department.id" from="${org.bjou.Department.list()}" optionKey="id" optionValue="departmentName" value="${courseInstance?.department?.id}" class="many-to-one" noSelection="['null': '']"/>
</div>

<div class="fieldcontain ${hasErrors(bean: courseInstance, field: 'majorLevel', 'error')} ">
	<label for="majorLevel">
		<g:message code="course.majorLevel.label" default="Major Level" />
		
	</label>
	<g:textField name="majorLevel" value="${courseInstance?.majorLevel}"/>
</div>

<div class="fieldcontain ${hasErrors(bean: courseInstance, field: 'courseStatus', 'error')} ">
	<label for="courseStatus">
		<g:message code="course.courseStatus.label" default="Course Status" />
		
	</label>
  <g:select optionKey="key" optionValue="value"
                        from="${['':'-全部-','正开':'正开','可考':'可考','不可考':'不可考','正开拟不开设':'正开拟不开设','禁开拟不开设':'禁开拟不开设']}"
                          name='courseStatus' value="${courseInstance?.courseStatus}" >
               </g:select>
	
</div>

<div class="fieldcontain ${hasErrors(bean: courseInstance, field: 'currentTerm', 'error')} ">
	<label for="currentTerm">
		<g:message code="course.currentTerm.label" default="Current Term" />
		
	</label>
	${courseInstance?.currentTerm}
</div>









<div class="fieldcontain ${hasErrors(bean: courseInstance, field: 'majorName', 'error')} ">
	<label for="majorName">
		<g:message code="course.majorName.label" default="Major Name" />
		
	</label>
	<g:textField name="majorName" value="${courseInstance?.majorName}"/>
</div>

<div class="fieldcontain ${hasErrors(bean: courseInstance, field: 'ruleCode', 'error')} ">
	<label for="ruleCode">
		<g:message code="course.ruleCode.label" default="Rule Code" />
		
	</label>
	<g:textField name="ruleCode" value="${courseInstance?.ruleCode}"/>
</div>

				</fieldset>
				<fieldset class="buttons">
					<g:actionSubmit class="gh_button save" action="update" value="${message(code: 'default.button.update.label', default: 'Update')}" />
					<g:actionSubmit class="gh_button icon danger" action="delete" value="${message(code: 'default.button.delete.label', default: 'Delete')}" formnovalidate="" onclick="return confirm('${message(code: 'default.button.delete.confirm.message', default: 'Are you sure?')}');" />
				</fieldset>
			</g:form>
		</div>
           <!-- end -->
          </div>
        </div>
      </div>
    </div>
  </div>
          
          
          
          
          
          
		
	
